package com.sailing.lianxi.io.nio;

import java.nio.CharBuffer;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Map;
import java.util.SortedMap;
import java.util.Map.Entry;

public class NioTest {

	
	public static void t1(){
//		CharBuffer buff =  CharBuffer.allocate(8);
//		System.out.println("capacity: "+buff);
//		System.out.println("limit: "+buff.limit());
//		System.out.println("position: "+buff.position());
//		buff.put("a");
//		buff.put("b");
//		buff.put("c");
//		System.out.println("加入三个元素后，position="+buff.position());
//		buff.flip();
//		System.out.println("执行flip后 limit="+buff.limit());
		SortedMap<String, Charset> map = Charset.availableCharsets();
		for ( Entry<String, Charset> entity : map.entrySet()) {
//			System.out.println("key="+entity.getKey()+", value="+entity.getValue());
		}
	}
	
	public static void main(String[] args) {
		t1();
	}
}
